package com.leoman.service;

import com.leoman.entity.UserAddress;
import com.leoman.exception.AddressNotFindException;
import com.leoman.exception.ParamErrorException;
import com.leoman.exception.UserNotFindException;
import com.leoman.exception.UserSealStatusException;
import com.leoman.service.common.ICommonService;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * UserAddressService
 * Created by 涂奕恒 on 2016/11/23 0023 下午 3:55.
 */
public interface UserAddressService extends ICommonService<UserAddress> {

    // 查询用户收货地址列表（分页）
    Page<UserAddress> iPageByUserId(Integer userId, Integer pageNum, Integer pageSize);

    // 用户添加or修改收货地址
    void iAddAddressInfo(Integer userId,
                         Integer addressId,
                         String userName,
                         String mobile,
                         Integer regionId,
                         String description,
                         Integer isDefault) throws ParamErrorException, UserNotFindException, UserSealStatusException;

    // 用户删除收货地址
    void iDeleteAddressInfo(Integer addressId) throws ParamErrorException, AddressNotFindException;

    // 查询用户收信地址列表
    List<UserAddress> findListByUserId(Integer userId);

    // 查询用户收信地址列表
    UserAddress findDefaultByUserId(Integer userId);
}